package com.tianji.learning.controller;


import com.tianji.common.domain.dto.PageDTO;
import com.tianji.learning.domain.dto.ReplyDTO;
import com.tianji.learning.domain.page.ReplyPageQuery;
import com.tianji.learning.domain.vo.ReplyVO;
import com.tianji.learning.service.IInteractionReplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 互动问题的回答或评论 前端控制器
 * </p>
 *
 * @author rui
 * @since 2024-07-21
 */
@RestController
@RequestMapping("/replies")
@Api(tags = "互动问题的回答或评论")
@RequiredArgsConstructor
public class InteractionReplyController {
    private final IInteractionReplyService replyService;
    @ApiOperation("提交回答或者评论")
    @PostMapping()
    public void addReply(@RequestBody ReplyDTO replyDTO){
        replyService.addReply(replyDTO);
    }

    @ApiOperation("分页查询回答或评论")
    @GetMapping("/page")
    public PageDTO<ReplyVO> pageQueryReply(ReplyPageQuery pageQuery){
        return replyService.pageQueryReply(pageQuery);
    }
}
